﻿//Write a program that creates an array containing all letters from the alphabet (A-Z). Read a word from the console and print the index of each of its letters in the array.


using System;

namespace AlphabetTask
{
    class AlphabetTask
    {
        static void Main()
        {
            int i;
            char[] alphabet = new char[52];
            char letter = 'A';
            Console.Write("Enter the word:");
            string word = Console.ReadLine();


            for (i = 0; i < 26; i++)        //fill the array with upercase letters
            {
                alphabet[i] = letter;
                letter++;
            }

            letter = 'a';

            for (i = 26; i < alphabet.Length; i++)      //fill the array with lowercase letters
            {
                alphabet[i] = letter;
                letter++;
            }

            for (i = 0; i < word.Length; i++)       //Search letter coincidence in the word
            {
                for (int j = 0; j < 52; j++)
                {
                    if (word[i] == alphabet[j])
                    {
                        Console.Write((j + 1) + " ");   //Print result
                    }
                }
            }
            Console.WriteLine();
        }
    }
}
